Skip to content

Remove quantified constraints in FieldGrammar#11729

Merged
mergify[bot] merged 1 commit intohaskell:masterfrom
leana8959:remove-fg-quantified-constraints
Apr 13, 2026
Merged

Remove quantified constraints in FieldGrammar#11729
mergify[bot] merged 1 commit intohaskell:masterfrom
leana8959:remove-fg-quantified-constraints

Conversation

@leana8959
Copy link
Copy Markdown
Collaborator

@leana8959 leana8959 commented Apr 10, 2026

Previously field grammar was written with quantified constraints, this PR refactors them to concrete types (there's actually not a lot of them!). This would help the exact print project and in general make it easier to scrutinize which term is requiring which constraint.

EDIT: at the request of Jappie, here's an error caused by an application of type family on a quantified constraint when implementing exact print. Removing the quantification helps the compiler resolve this constraint.

error message
src/Distribution/PackageDescription/FieldGrammar.hs:718:6: error: [GHC-73138]
     Illegal type synonym family application Annotate
                                                 mod (RelativePath from to) in instance:
        Newtype
          [Annotate mod (RelativePath from to)]
          (ListWith mod FSep (RelativePathNT from to) (RelativePath from to))
     In the quantified constraint forall from (to :: FileOrDir).
                                    Newtype
                                      [Annotate mod (RelativePath from to)]
                                      (ListWith
                                         mod FSep (RelativePathNT from to) (RelativePath from to))
      In the type signature:
        buildInfoFieldGrammar' :: forall mod
                                         c
                                         g. (FieldGrammarWith mod c g,
                                             Applicative (g mod (BuildInfoWith mod)),
                                             L.HasBuildInfoWith mod (BuildInfoWith mod),
                                             Newtype [Annotate mod LegacyExeDependency] (ListWith mod CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
                                             c (ListWith mod CommaFSep (Identity LegacyExeDependency) LegacyExeDependency),
                                             Newtype [Annotate mod ExeDependency] (ListWith mod CommaFSep (Identity ExeDependency) ExeDependency),
                                             c (ListWith mod CommaFSep (Identity ExeDependency) ExeDependency),
                                             Newtype [Annotate mod String] (ListWith mod NoCommaFSep Token' String),
                                             c (ListWith mod NoCommaFSep Token' String),
                                             Newtype [Annotate mod PkgconfigDependency] (ListWith mod CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
                                             c (ListWith mod CommaFSep (Identity PkgconfigDependency) PkgconfigDependency),
                                             forall from to.
                                             Newtype [Annotate mod (RelativePath from to)] (ListWith mod FSep (RelativePathNT from to) (RelativePath from to)),
                                             c (ListWith mod FSep (RelativePathNT Framework File) (RelativePath Framework File)),
                                             Newtype [Annotate mod (DependencyWith mod)] (ListWith mod CommaVCat (Identity (DependencyWith mod)) (DependencyWith mod)),
                                             c (ListWith mod CommaVCat (Identity (DependencyWith mod)) (DependencyWith mod))) =>
                                            g mod (BuildInfoWith mod) (BuildInfoWith mod)
    |
718 |   :: forall mod c g
    |      ^^^^^^^^^^^^^^...

This change doesn't change behaviour or interface.

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

@leana8959 leana8959 changed the title Remove fg quantified constraints Remove quantified constraints in FieldGrammar Apr 10, 2026
@leana8959 leana8959 force-pushed the remove-fg-quantified-constraints branch from 4a6f208 to 2cdb355 Compare April 10, 2026 11:56
@leana8959 leana8959 marked this pull request as ready for review April 10, 2026 11:59
Copy link
Copy Markdown
Collaborator

@ffaf1 ffaf1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable!

@leana8959 leana8959 marked this pull request as draft April 10, 2026 12:25
@leana8959
Copy link
Copy Markdown
Collaborator Author

leana8959 commented Apr 10, 2026

Drafting because I forgot to remove the language extension "QuantifiedConstraints".

Copy link
Copy Markdown
Collaborator

@sheaf sheaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this looks fine (modulo actually removing the LANGUAGE pragma of course). I felt slightly bad for adding the quantified constraints in the first place; I agree it's not so bad to spell them out. Thanks!

@leana8959 leana8959 force-pushed the remove-fg-quantified-constraints branch from 2cdb355 to c0dd136 Compare April 10, 2026 12:38
@leana8959 leana8959 marked this pull request as ready for review April 10, 2026 21:39
@leana8959 leana8959 added the merge me Tell Mergify Bot to merge label Apr 11, 2026
@mergify mergify bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days queued labels Apr 11, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 13, 2026

Merge Queue Status

This pull request spent 1 hour 39 minutes 9 seconds in the queue, including 1 hour 28 minutes 28 seconds running CI.

Waiting for:

  • check-neutral = Validate post job

or

  • check-skipped = Validate post job

or

  • check-success = Validate post job
All conditions
  • any of [🛡 GitHub branch protection]:
    • check-neutral = Validate post job
    • check-skipped = Validate post job
    • check-success = Validate post job
  • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

Reason

The merge conditions cannot be satisfied due to failing checks

Failing checks:

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

mergify bot added a commit that referenced this pull request Apr 13, 2026
@mergify mergify bot added dequeued and removed queued labels Apr 13, 2026
@geekosaur
Copy link
Copy Markdown
Collaborator

@mergify queue

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 13, 2026

Merge Queue Status

This pull request spent 2 hours 1 minute 28 seconds in the queue, including 1 hour 51 minutes 6 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

@mergify mergify bot added queued and removed dequeued labels Apr 13, 2026
mergify bot added a commit that referenced this pull request Apr 13, 2026
@mergify mergify bot merged commit a909d63 into haskell:master Apr 13, 2026
283 of 284 checks passed
@mergify mergify bot removed the queued label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants